//
//  BaseTableViewController.m
//  RainbowFM
//
//  Created by jv on 14-12-6.
//  Copyright (c) 2014年 RB. All rights reserved.
//

#import "BaseTableViewController.h"

@interface BaseTableViewController ()

@end

@implementation BaseTableViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [self _initSuperSelf];
    [self _initSuperView];
}


#pragma mark - init

- (void)_initSuperSelf
{
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    backButton.width = 30.f;
    backButton.height = 30.f;
    backButton.left = 0.f;
    [backButton setBackgroundImage:[UIImage imageNamed:@"home_back_button"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(navBackAction) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    self.navigationItem.leftBarButtonItem = leftItem;

}


- (void)_initSuperView
{
    
}

#pragma mark - action

- (void)navBackAction
{
    UIViewController *ctrl = [self.navigationController popViewControllerAnimated:YES];
    if (ctrl == nil) {
        [self dismissViewControllerAnimated:YES completion:nil];
    }
}


#pragma mark - Navigation

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    
}

@end
